﻿Jxstar.currentPage = function() {
	var config = {param:{},initpage:function(page, define){},eventcfg:{}};

	var auditData = Jxstar.findComboData('audit');
	var authtypeData = Jxstar.findComboData('authtype');

	var cols = [
	{col:{header:'记录状态', width:84, sortable:true, align:'center',
		editable:false,
		editor:new Ext.form.ComboBox({
			store: new Ext.data.SimpleStore({
				fields:['value','text'],
				data: auditData
			}),
			emptyText: jx.star.select,
			mode: 'local',
			triggerAction: 'all',
			valueField: 'value',
			displayField: 'text',
			editable:false,
			value: auditData[0][0]
		}),
		renderer:function(value){
			for (var i = 0; i < auditData.length; i++) {
				if (auditData[i][0] == value)
					return auditData[i][1];
			}
		}}, field:{name:'contarct_bill__auditng',type:'string'}},
	{col:{header:'合同编号', width:120, sortable:true}, field:{name:'contarct_bill__contract_code',type:'string'}},
	{col:{header:'合同名称', width:195, sortable:true}, field:{name:'contarct_bill__contract_name',type:'string'}},
	{col:{header:'发票编号', width:100, sortable:true}, field:{name:'contarct_bill__bill_code',type:'string'}},
	{col:{header:'开票日期', width:100, sortable:true, renderer:function(value) {
			return value ? value.format('Y-m-d') : '';
		}}, field:{name:'contarct_bill__bill_date',type:'date'}},
	{col:{header:'商品名称', width:157, sortable:true}, field:{name:'contarct_bill__goods_name',type:'string'}},
	{col:{header:'型号规格', width:100, sortable:true}, field:{name:'contarct_bill__goods_type',type:'string'}},
	{col:{header:'数量', width:100, sortable:true, hidden:true, renderer:JxUtil.formatNumber(2)}, field:{name:'contarct_bill__goods_sl',type:'float'}},
	{col:{header:'单位', width:100, sortable:true, hidden:true}, field:{name:'contarct_bill__goods_dw',type:'string'}},
	{col:{header:'单价(万元)', width:100, sortable:true, hidden:true, renderer:JxUtil.formatNumber(6)}, field:{name:'contarct_bill__goods_dj',type:'float'}},
	{col:{header:'总金额(万元)', width:100, sortable:true, renderer:JxUtil.formatNumber(6)}, field:{name:'contarct_bill__goods_je',type:'float'}},
	{col:{header:'开票人', width:76, sortable:true}, field:{name:'contarct_bill__bill_user',type:'string'}},
	{col:{header:'项目编号', width:100, sortable:true}, field:{name:'contarct_bill__project_code',type:'string'}},
	{col:{header:'项目名称', width:161, sortable:true}, field:{name:'contarct_bill__project_name',type:'string'}},
	{col:{header:'备注', width:100, sortable:true, hidden:true}, field:{name:'contarct_bill__comments',type:'string'}},
	{col:{header:'项目ID', width:100, sortable:true, hidden:true}, field:{name:'contarct_bill__project_id',type:'string'}},
	{col:{header:'合同ID', width:100, sortable:true, hidden:true}, field:{name:'contarct_bill__contract_id',type:'string'}},
	{col:{header:'主键', width:100, sortable:true, hidden:true}, field:{name:'contarct_bill__bill_id',type:'string'}},
	{col:{header:'开票单位', width:100, sortable:true, hidden:true}, field:{name:'contarct_bill__provider_name',type:'string'}},
	{col:{header:'开票单位ID', width:100, sortable:true, hidden:true}, field:{name:'contarct_bill__provider_id',type:'string'}},
	{col:{header:'费用代码', width:100, sortable:true, hidden:true}, field:{name:'contarct_bill__fee_code',type:'string'}},
	{col:{header:'费用类型', width:100, sortable:true, hidden:true}, field:{name:'contarct_bill__fee_type',type:'string'}},
	{col:{header:'登记人', width:100, sortable:true, hidden:true}, field:{name:'contarct_bill__write_user',type:'string'}},
	{col:{header:'授权形式', width:100, sortable:true, align:'center',
		editable:false,
		editor:new Ext.form.ComboBox({
			store: new Ext.data.SimpleStore({
				fields:['value','text'],
				data: authtypeData
			}),
			emptyText: jx.star.select,
			mode: 'local',
			triggerAction: 'all',
			valueField: 'value',
			displayField: 'text',
			editable:false,
			value: authtypeData[0][0]
		}),
		renderer:function(value){
			for (var i = 0; i < authtypeData.length; i++) {
				if (authtypeData[i][0] == value)
					return authtypeData[i][1];
			}
		}}, field:{name:'contarct_bill__auth_type',type:'string'}}
	];
	
	config.param = {
		cols: cols,
		sorts: null,
		hasQuery: '1',
		isedit: '0',
		isshow: '1',
		funid: 'contract_bill'
	};
	
	
		
	return new Jxstar.GridNode(config);
}